Crate unidiff

Source
Expand description

Unified diff parsing/metadata extraction library for Rust

§Examples

extern crate unidiff;

use unidiff::PatchSet;

fn main() {
    let diff_str = "diff --git a/added_file b/added_file
new file mode 100644
index 0000000..9b710f3
--- /dev/null
+++ b/added_file
@@ -0,0 +1,4 @@
+This was missing!
+Adding it now.
+
+Only for testing purposes.";
    let mut patch = PatchSet::new();
    patch.parse(diff_str).ok().expect("Error parsing diff");
}

Structs§

Enums§

Constants§

Type Aliases§

  • unidiff::parse result type